write a function hackerrank solution

join shbcf.ru